public class SolutionOffer10I {
    public int fib(int n) {
        if (n==0) return 0;
        if (n==1) return 1;
        int a=0,b=1,c=0;
        for (int i=2;i<=n;i++){
            c=(a+b)%1000000007;
            a=b;
            b=c;
        }
        return c;
    }

    public static void main(String[] args) {
        System.out.println(new SolutionOffer10I().fib(5));
    }
}
